﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.IO;

namespace SVNHelper
{
    class Program
    {
        static void Main(string[] args)
        {
            string path = Assembly.GetEntryAssembly().CodeBase;
            path = path.Substring("file:///".Length).Replace("/", "\\");
            string[] dirs = Directory.GetDirectories(new FileInfo(path).DirectoryName);
            foreach (var item in dirs)
            {
                ClearDir(item);
            }
            Console.WriteLine("Complete!");
        }

        static void ClearDir(string dir)
        {
            try
            {
                if (Directory.Exists(dir + "\\obj"))
                    Directory.Delete(dir + "\\obj",true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            try
            {
                if (Directory.Exists(dir + "\\bin"))
                    Directory.Delete(dir + "\\bin", true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                Console.Read();
            }
        }
    }
}
